<template>
  <div class="allShop">
    <template>
      <el-button type="primary" icon="plus" @click="addMendian" style="margin:0 10px 20px 0">新建入库单</el-button>
    </template>
    <avue-crud
      ref="crud"
      style="width:100%"
      :data="loadData"
      :option="tableOption"
      :table-loading="loading"
    >
      <template slot-scope="scope" slot="indexLabel">
        <span>{{scope.row.$index+(page.current - 1) * page.size + 1}}</span>
      </template>
      <template
        slot="dqrNum"
        slot-scope="scope"
      >{{ parseFloat(scope.row.inNum ? scope.row.inNum : 0) - parseFloat(scope.row.confirmInNum ? scope.row.confirmInNum : 0)}}</template>
      <template slot="menu" slot-scope="scope">
        <el-button
          @click="ruku(scope.row)"
          type="text"
          icon="el-icon-s-management"
          v-if="scope.row.status=='00' || scope.row.status=='01'"
        >入库</el-button>
        <!-- ||  scope.row.dqrNum != 0 -->
        <el-button
          @click="wancheng(scope.row)"
          type="text"
          icon="el-icon-document-delete"
          v-if="scope.row.status=='01'"
        >完成</el-button>
        <el-button @click="details(scope.row)" type="text" icon="el-icon-view">详情</el-button>
      </template>
    </avue-crud>
    <template>
      <div style="width:100%;position:relative;height:50px">
        <el-pagination
          :page-sizes="[10, 20,30,40, 50, 100]"
          :pager-count="7"
          :current-page="page.current"
          :page-size="page.size"
          :total="page.total"
          layout="total, sizes, prev, pager, next, jumper"
          style="margin:2% 0;position:absolute;right:1%"
          background
          @size-change="sizeChange"
          @current-change="currentChange"
        ></el-pagination>
      </div>
    </template>
  </div>
</template>

<script src='./allShop.js'></script>

<style lang="scss">
.allShop {
  margin: 10px 0px;
}
</style>